<template>
  <div>
    <div class="select_top">
      <el-input placeholder="请输入分类名称、编号搜索" style="width:29%;margin-right:10px"></el-input><el-button>搜索</el-button>
      <el-button type="primary" style="float:right" @click="showM=true">新增</el-button>
    </div>
    <el-table
      ref="filterTable"
      :data="tableData"
      style="width: 92%;font-size:13px;margin: 20px auto"
    >

      <el-table-column
        prop="name"
        label="排序"
      >
      </el-table-column>
      <el-table-column
        prop="name"
        label="编号"
      >
      </el-table-column>
      <el-table-column
        prop="name"
        label="分类名称"
      >
      </el-table-column>
      <el-table-column
        label="操作"
        width="450"
      >
        <template slot-scope="scope">
          <el-button
            type="primary"
            size="small"
            @click="showM2=true"
          >
            添加子分类
          </el-button>
          <el-button
            type="primary"
            size="small"
            @click="showM2=true"
          >
            编辑
          </el-button>
          <el-button
            type="primary"
            size="small"
          >
            删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog
      title="新增"
      :visible.sync="showM"
      width="40%"
    >
      <el-form labelWidth="100px">
        <el-form-item label="指标排序">
          <el-input-number v-model="zhibiaoNum" style="width:100%" controlsPosition="right"
            :min="1"
            :max="10"
          ></el-input-number>
        </el-form-item>
        <el-form-item label="编号">
          <el-input></el-input>
        </el-form-item>

        <el-form-item label="分类名称">
          <el-input></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showM = false">取 消</el-button>
        <el-button type="primary" @click="showM = false">新 增</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="修改责任单位"
      :visible.sync="showM2"
      width="40%"
    >
      <el-form labelWidth="100px">
        <el-form-item label="指标排序">
          <el-input-number v-model="zhibiaoNum" style="width:100%" controlsPosition="right"
            :min="1"
            :max="10"
          ></el-input-number>
        </el-form-item>
        <el-form-item label="编号">
          <el-input></el-input>
        </el-form-item>

        <el-form-item label="分类名称">
          <el-input></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showM2 = false">取 消</el-button>
        <el-button type="primary" @click="showM2 = false">修 改</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      showCheck: false,
      showM: false,
      showM2: false,
      zhibiaoNum: '',
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄',
        tag: '家',
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄',
        tag: '公司',
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄',
        tag: '家',
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄',
        tag: '公司',
      }],
    };
  },
};
</script>

<style lang="stylus">
.el-input--suffix .el-input__inner
  font-size 13px
.el-button
  font-size 13px
.el-table th>.cell
  text-align center
.el-table .cell
  text-align center
.el-select
  width 14%
  margin-right 1%
.select_top
  width 92%
  margin 20px auto
</style>
